package com.scedu.entity;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.Size;
import java.util.Date;

@Data
@NoArgsConstructor
@AllArgsConstructor
@ToString
public class Emp {
    private String id;

    @NotEmpty(message="姓名: 不能为空")
    @Size(max = 10, message="姓名: 长度不能超过10个字符")
    private String name;
    private Double salary;
    private Integer age;
    @DateTimeFormat(pattern="yyyy-MM-dd")
    private Date bir;
}
